<template>
  <div class="table-container">
    <el-table :data="tableData" border style="width: 100%">
      <el-table-column prop="name" label="日期" min-width="80" align="center"></el-table-column>
      <el-table-column prop="oilCount" label="加油架次" min-width="60" align="center"></el-table-column>
      <el-table-column prop="fuelQuantity" label="加油量（吨）" min-width="80" align="center"></el-table-column>
      <el-table-column prop="rateJson" label="温度/密度" min-width="200" align="center">
        <template slot-scope="scope">
          <div v-html="scope.row.rateJson ? parseRateJson(scope.row.rateJson) : ''"></div>
        </template>
      </el-table-column>
      <el-table-column prop="carInfo" label="使用车辆" min-width="160" align="center">
        <template slot-scope="scope">
          <div v-html="scope.row.carInfo ? towWords(scope.row.carInfo) : ''"></div>
        </template>
      </el-table-column>
      <el-table-column prop="collectCount" label="收油数量（车）" min-width="80" align="center"></el-table-column>
      <el-table-column prop="collectWeight" label="收油重量（吨）" min-width="80" align="center"></el-table-column>
      <el-table-column prop="sendInfo" label="发油信息" min-width="120" align="center"></el-table-column>
      <el-table-column prop="averageFuelQuantity" label="近7天用油量" min-width="80" align="center"></el-table-column>
      <el-table-column prop="days" label="存油可用天数" min-width="80" align="center"></el-table-column>
      <el-table-column prop="workName" label="工作人员" min-width="120" align="center">
        <template slot-scope="scope">
          <div v-html="scope.row.workName ? towWords(scope.row.workName) : ''"></div>
        </template>
      </el-table-column>
      <el-table-column prop="selfInfo" label="自提油情况" min-width="80" align="center">
        <template slot-scope="scope">
          {{ scope.row.selfInfo || '无' }}
        </template>
      </el-table-column>
      <el-table-column prop="info" label="前日迎检情况" min-width="80" align="center"></el-table-column>
      <!-- <el-table-column prop="error" label="异常情况" min-width="80" align="center"></el-table-column> -->
      <!-- <el-table-column prop="reportDate" label="上报时间" min-width="80" align="center"></el-table-column> -->
    </el-table>
  </div>
</template>

<script>
import { parseRateJson, towWords } from "./parseRateJson";
export default {
  name: "rikezeTable",
  props: {
    tableData: {
      type: Array,
      default: () => [],
    },
  },
  methods: {
    parseRateJson,
    towWords,
  },
};
</script>

<style lang="scss" scoped></style>
